package com.taotao.sys.controller;

import com.taotao.common.Pagination;
import com.taotao.common.RespData;
import com.taotao.common.annotation.CurrUserId;
import com.taotao.sys.entity.SysRole;
import com.taotao.sys.model.SysRoleParam;
import com.taotao.sys.service.SysRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Set;



/**
 * <p>
 * 系统角色表控制器
 * </p>
 *
 * @author Fan Beibei
 * @version V1.0
 * @since 2025-05-18 23:03:09
 */
@Slf4j
@Api(tags = "系统角色表接口")
@RestController
@RequestMapping("/sys/role")
public class SysRoleController{

    @Autowired
    private SysRoleService sysRoleService;


    @ApiOperation(value = "根据ID查询", notes = "")
    @ResponseBody
    @GetMapping("/queryPage")
    public RespData<Pagination<SysRole, SysRoleParam>> queryPage(@RequestBody Pagination<SysRole, SysRoleParam> param) {

//        SysRole sysRole = sysRoleService.queryById(id);

        return RespData.successResp();

    }


    @ApiOperation(value = "根据ID查询", notes = "")
    @ResponseBody
    @GetMapping("/queryById")
    public RespData<SysRole> queryById(@RequestParam("id") java.lang.Long id) {

//        SysRole sysRole = sysRoleService.queryById(id);

        return RespData.successResp();

    }


    @ApiOperation(value = "批量删除", notes = "")
    @ResponseBody
    @PostMapping("/batchDel")
    public RespData<Integer> batchDel(@RequestBody Set<java.lang.Long> ids, @CurrUserId Long userId) {

//        int effectCount = sysRoleService.softDelByIds(ids, userId);

        return RespData.successResp();

    }


    @ApiOperation(value = "新增或更新", notes = "")
    @ResponseBody
    @PostMapping("/addOrUpdate")
    public RespData<java.lang.Long> addOrUpdate(@RequestBody SysRole param, @CurrUserId Long userId) {

//        java.lang.Long id =sysRoleService.addOrUpdate(param, userId);

        return RespData.successResp();

    }


}
